﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <link href="css/bootstrap.css" rel="stylesheet" />
    <link href="css/site.css" rel="stylesheet" />
    <script src="js/vue.js"></script>
    <script src="js/axios.js"></script>
    <script src="js/beetlex4axios.js"></script>
    <script src="js/component.js"></script>
    <title>Beetlex samples</title>

</head>
<body>
    <div id="page">
        <page-header>

        </page-header>
        <div class="container" style="margin-top:60px;">
            <div class="row">

                <div class="form-group">
                    <label for="exampleInputEmail1">Name</label>
                    <input type="text" class="form-control" placeholder="name" v-model="getHeader.data.name">
                </div>
                <div class="form-group">
                    <span>{{getHeader.result}}</span>
                </div>
                <button type="button" @click="getHeader.get()" class="btn btn-default">GetHeader</button>

            </div>


            <div class="row">

                <div class="form-group">
                    <label for="exampleInputEmail1">Name</label>
                    <input type="text" class="form-control" placeholder="name" v-model="setCookie.data.name">
                </div>
                <div class="form-group">
                    <label for="exampleInputEmail1">Value</label>
                    <input type="text" class="form-control" placeholder="name" v-model="setCookie.data.value">
                </div>

                <button type="button" @click="setCookie.post()" class="btn btn-default">SetCookie</button>

            </div>
            <div class="row">

                <div class="form-group">
                    <label for="exampleInputEmail1">Name</label>
                    <input type="text" class="form-control" placeholder="name" v-model="getCookie.data.name">
                </div>
                <div class="form-group">
                    <span>{{getCookie.result}}</span>
                </div>
                <button type="button" @click="getCookie.get()" class="btn btn-default">GetCookie</button>

            </div>
        </div>

      


    </div>

    <script>
        var getCookie = new beetlexAction("/GetCookie", { name: '' }, '');
        var setCookie = new beetlexAction("/SetCookie", { name: '', value: '' }, '');
        setCookie.requested = function (r) { alert('设置成功!') };
        var getHeader = new beetlexAction("/GetHeader", { name: 'User-Agent' }, '');
        var model = {
            getHeader: getHeader,
            getCookie: getCookie,
            setCookie: setCookie
        };
        var page = new Vue({
            el: '#page', data: model
        });

    </script>
</body>

</html>